<template>
    <div>
        <div style="padding-bottom: 10px">
            <Button type="success" @click="showAdd">添加<Icon type="ios-add-circle-outline" /></Button>
        </div>
        <Table :columns="columns11" :data="data10" border height="400">
            <template slot-scope="{ row, index }" slot="action">
                <Button type="primary" size="small" style="margin-right: 5px" @click="edit(index)">修改</Button>
                <Button type="error" size="small" @click="remove(index)">删除</Button>
            </template>
        </Table>
        <Page :total="100" show-sizer style="padding-top: 10px"/>
        <Modal v-model="show_add" fullscreen title="添加部门">
            <department-form></department-form>
        </Modal>
    </div>

</template>
<script>
    import DepartmentForm from "../../../components/DepartmentForm";

    export default {
        components:{
          DepartmentForm
        },
        name:"Department",
        data () {
            return {
                show_add:false,
                columns11: [
                    {
                        title: '部门id',
                        key: 'deptId',
                        align: 'center',
                        width: 200
                    },
                    {
                        title: '部门名称',
                        key: 'deptName',
                        align: 'center',

                    },
                    {
                        title: '操作',
                        key: 'operate',
                        align: 'center',
                        slot:'action',

                    }
                ],
                data10: []
            }


        },
        mounted () {
            const data = [];
            for (let i = 0; i < 10; i++) {
                data.push({
                    key: i,
                    deptName: '研发部',
                    deptId: "1",
                });
            }
            this.data10 = data;
        },
        methods:{
            remove(index){

            },
            edit(index){

            },
            showAdd(){
                this.show_add = !this.show_add
            }
        }
    }
</script>